package com.pai4j.pgc.pojo.es;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * ES 数据保存请求实体
 *
 * @Author: yefazhi
 * @Create: 2021/8/29
 * @Version: 1.0
 */
@Data
public class EsSearchPageResponse implements Serializable{

    /**
     * 总数
     */
    private Long total;
    /**
     * 高亮显示数据
     */
    private List<EsSearchResponse> pageList;
    private Integer pageNo;
    private Integer pageSize;
    private Long pageCount;


    public static EsSearchPageResponse of(int pageNo, int pageSize, Long pageCount, Long total, List<EsSearchResponse> pageList) {
        EsSearchPageResponse esSearchPageResponse = new EsSearchPageResponse();
        esSearchPageResponse.setPageNo(pageNo);
        esSearchPageResponse.setPageSize(pageSize);
        esSearchPageResponse.setPageCount(pageCount);
        esSearchPageResponse.setTotal(total);
        esSearchPageResponse.setPageList(pageList);
        return esSearchPageResponse;
    }
}
